package com.nail.dao.impl;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.nail.bean.Account;
import com.nail.dao.IDemoDao;
import com.nail.mapper.IDemoMapper;

@Repository("demoDao") //被这个注解所修饰的DAO或repositories类会被ComponentScan发现并配置。
public class DemoDao extends BaseDao implements IDemoDao {

	@Autowired
	IDemoMapper demoMapper;
	
	public Account getAccountById(@Param("accountId")Integer accountId){
		return demoMapper.getAccountById(accountId);
	}
	
	
	public List<Map<String, Object>> getData(){
		String sql = "select distinct freight_entrust.order_id,freight_entrust.consignor,freight_entrust.departure_port,freight_entrust.departure,freight_entrust.destination,freight_entrust.destination_port, freight_entrust.business_time,freight_entrust.sales_man,freight_entrust.goods_name,freight_entrust.loading_place,freight_entrust.loading_contact,freight_entrust.loading_mobile, freight_entrust.loading_phone,freight_entrust.loading_memo,freight_entrust.send_unit,freight_entrust.send_fax,freight_entrust.unload_place,freight_entrust.unload_contact, freight_entrust.unload_phone,freight_entrust.unload_mobile,freight_entrust.unload_memo,freight_entrust.receive_unit,freight_entrust.receive_fax,freight_entrust.operating_terms, freight_entrust.transport_terms,freight_entrust.business_type,freight_entrust.payment_type,freight_entrust.work_no,freight_entrust.entry_person,freight_entrust.operator, freight_entrust.assit_person,freight_entrust.option_dept,freight_entrust.split_no,freight_entrust.split_source,freight_entrust.agreement_no,freight_entrust.add_time, freight_entrust.able_status,freight_entrust.cancel_status,freight_entrust.type,freight_entrust.audit_status,freight_entrust.business_status,freight_entrust.business_operator, freight_entrust.business_option_time,freight_entrust.bill_lade_no,freight_entrust.org_id,freight_entrust.company_id,freight_entrust.user_id,freight_entrust.l_u_box, freight_entrust.stevedoring_time,freight_entrust.goods_type,freight_entrust.car_no,freight_entrust.driver,freight_entrust.driver_phone,freight_entrust.carpooling, freight_entrust.start_table_no,freight_entrust.end_table_no,freight_entrust.free_stagnate_time,freight_entrust.free_stack_time,freight_entrust.carpool_no,freight_entrust.car_code, freight_entrust.trailer_no,freight_entrust.driver_license_no,freight_entrust.billing,freight_entrust.heavy_mileage,freight_entrust.light_mileage,freight_entrust.count_mileage, freight_entrust.heavy_rate,freight_entrust.light_rate,freight_entrust.average_rate,freight_entrust.heavy_fuel,freight_entrust.light_fuel,freight_entrust.count_fuel,freight_entrust.oil_card,freight_entrust.declaration_form,freight_entrust.open_harbor_time,freight_entrust.close_harbor_time,freight_entrust.theory_fuel,freight_entrust.actual_fuel,freight_entrust.back_no,freight_entrust.child_work_no,freight_entrust.car_type,freight_entrust.guards,freight_entrust.biz_type,freight_entrust.match_type,freight_entrust.up_biz_id,freight_entrust.down_biz_id,freight_entrust.up_dock_no,freight_entrust.down_dock_no,freight_entrust.up_city_no,freight_entrust.down_city_no,freight_entrust.ship_company_id,freight_entrust.consignor_id,freight_entrust.start_trailer_id,freight_entrust.destination_trailer_id,freight_entrust.container_status,freight_entrust.entrust_status,freight_entrust.business_entrust,freight_entrust.create_type,freight_entrust.cap_order_id,freight_entrust.dispatch_id,freight_entrust.cabinet_status,freight_entrust.barge_company_id,freight_entrust.loading_place_id,freight_entrust.unload_place_id,freight_entrust.sales_id,freight_entrust.check_date,freight_entrust.cancel_entrust,freight_entrust.cancel_reason,freight_entrust.is_send_car_msg,freight_transport_barge.transport_id,freight_transport_barge.shipping_company,freight_transport_barge.trunk_boat_name,freight_transport_barge.trunk_voyage,freight_transport_barge.waybill_no,freight_transport_barge.shipment_time,freight_transport_barge.to_shipment_time,freight_transport_barge.forecast_sailing_time,freight_transport_barge.forecast_arrival_time,freight_transport_barge.start_trailer,freight_transport_barge.loading_time,freight_transport_barge.booking_principal,freight_transport_barge.loading_level,freight_transport_barge.destination_trailer,freight_transport_barge.booking_receive,freight_transport_barge.delivery_level,freight_transport_barge.pre_delivery_date,freight_transport_barge.barge_company,freight_transport_barge.branch_boat_name,freight_transport_barge.branch_voyage,freight_transport_barge.branch_arrive_time,freight_transport_barge.branch_transit_time,freight_transport_barge.three_boat_name,freight_transport_barge.three_voyage,freight_transport_barge.three_begin_time,freight_transport_barge.barge_status,freight_transport_barge.used_booking_cabin,freight_transport_barge.used_booking_cabin_time,freight_transport_barge.insur,freight_transport_barge.route_id,freight_transport_barge.route_name_ch,freight_item.item_id,freight_item.goods_owner,freight_item.freight_company,freight_item.gross_weight,freight_item.entrust_no,freight_item.boxed,freight_item.boxed_mark,freight_item.finance_item,freight_item.special_item,freight_item.overweight_status,freight_item.reserve_car,freight_item.receive_no,freight_item.submit_company,freight_item.submit_company_time,freight_item.claim_status,freight_item.claim_status_content,freight_item.danger_status,freight_item.detain_release,freight_item.detain_release_memo,freight_item.detain_release_operator,freight_item.detain_release_time,freight_item.instead_money,freight_item.receive_money,freight_item.receive_money_time,freight_insur_info.insur_id,freight_insur_info.insur_no,freight_insur_info.insur_fee,freight_insur_info.insur_company,freight_insur_info.goods_value,freight_insur_info.insur_type,freight_insur_info.insured,freight_insur_info.insured_time,freight_insur_info.insur_rate,freight_insur_info.public_insur_company_type,freight_status.status_id,freight_status.ship_arrive,freight_status.ship_arrive_time,freight_status.ship_arrive_day,freight_status.destination_port_paper,freight_status.destination_port_paper_time,freight_status.destination_port_car,freight_status.destination_port_car_time,freight_status.loading_car,freight_status.loading_car_time,freight_status.board,freight_status.board_time,freight_status.booking_cabin,freight_status.booking_cabin_time,freight_status.cabinet_no,freight_status.cabinet_no_time,freight_status.waybill_return,freight_status.waybill_return_time,freight_status.loading_paper,freight_status.loading_paper_time,freight_status.loading_complate,freight_status.loading_complate_time,freight_status.delivery_car,freight_status.delivery_complete,freight_status.delivery_complete_time,freight_status.loading_back,freight_status.loading_back_time,freight_status.delivery_receive,freight_status.delivery_receive_time,freight_status.check_cabinet,freight_status.check_cabinet_time,freight_status.barge_import_status,freight_status.delivery_car_time,freight_status.take_delivery_no,freight_status.submit_scheduling,freight_status.submit_scheduling_time,freight_status.goods,freight_status.goods_time,freight_status.mention_cabinet,freight_status.mention_cabinet_time,freight_status.detain_memo,freight_status.handle,freight_status.handle_time,freight_status.assign,freight_status.assign_time,freight_status.option_goods,freight_status.option_goods_time,freight_status.back,freight_status.back_time,freight_status.is_first_assign,freight_status.is_first_cabinet_no,freight_status.expatriate_team,freight_status.expatriate_team_time,freight_other.other_id,freight_other.memo1,freight_other.time_memo1,freight_other.memo2,freight_other.time_memo2,freight_other.memo3,freight_other.time_memo3,freight_other.memo4,freight_other.time_memo4,freight_other.memo5,freight_other.time_memo5,freight_other.memo6,freight_other.time_memo6,freight_other.memo7,freight_other.time_memo7,freight_other.memo8,freight_other.time_memo8,freight_other.memo9,freight_other.time_memo9,freight_other.memo10,freight_other.time_memo10,freight_other.memo11,freight_other.time_memo11,freight_other.memo12,freight_other.time_memo12,freight_other.memo13,freight_other.time_memo13,freight_other.memo14,freight_other.time_memo14,freight_other.memo15,freight_other.time_memo15,freight_other.memo16,freight_other.time_memo16,freight_other.memo17,freight_other.time_memo17,freight_other.memo18,freight_other.time_memo18,freight_other.memo19,freight_other.time_memo19,freight_other.memo20,freight_other.time_memo20 ,freight_entrust.subtype_name,freight_entrust.transit_port, freight_entrust.transit_port2, freight_entrust.transit_port_no, freight_entrust.transit_port2_no, freight_transport_barge.transit_ship_arrive_time2 from freight_entrust"
				+ " inner join freight_transport_barge on freight_entrust.order_id=freight_transport_barge.transport_id"
				+ " inner join freight_item on freight_entrust.order_id=freight_item.item_id"
				+ " inner join freight_insur_info on freight_entrust.order_id=freight_insur_info.insur_id"
				+ " inner join freight_status on freight_entrust.order_id=freight_status.status_id"
				+ " inner join freight_other on freight_entrust.order_id=freight_other.other_id"
				+ " inner join freight_container on freight_entrust.order_id=freight_container.order_id"
				+ " left join freight_fee on freight_entrust.order_id=freight_fee.order_id "
				+ " LEFT JOIN freight_trunk_truck on freight_entrust.order_id = freight_trunk_truck.order_id where freight_entrust.order_id IN ('2c90da7e5d87dedb015d87dfb5300001','40281b815d871083015d87d954750001')";
		
		return demoMapper.getData2(sql);
	}
	
	public List<Account> getAccountListByAddTime(String addTime){
		return demoMapper.getAccountListByAddTime(addTime);
	}
	
	
}
